<%@page import="com.Service.BO.DirectoratesBO"%>
<%@page import="com.Service.BO.OrganizationBO"%>
<%@page import="com.Service.BO.CountryBO"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.List"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
    <head>
        <title>Service Directory</title>
        <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
        <style media="all" type="text/css">
            @import "css/all.css";.MandatoryColour {
                color: #F00;
            }
            .MandatoryColour {
                color: #F00;
            }
            .MandatoryColour {
                color: #F00;
            }
            #main #middle #center-column form .listing.form .bg .first #TabbedPanels2 .TabbedPanelsContentGroup .TabbedPanelsContent.TabbedPanelsContentVisible table {
                text-align: left;
            }
            #main #middle #center-column form .listing.form .bg .first #TabbedPanels2 .TabbedPanelsContentGroup .TabbedPanelsContent.TabbedPanelsContentVisible table {
                text-align: left;
            }
            #main #middle #center-column form .listing.form .bg .first #TabbedPanels2 .TabbedPanelsContentGroup .TabbedPanelsContent.TabbedPanelsContentVisible table tr td #description {
                text-align: left;
            }
            #main #middle #center-column form .listing.form .bg .first #TabbedPanels2 .TabbedPanelsContentGroup .TabbedPanelsContent.TabbedPanelsContentVisible table tr td {
                font-size: 10px;
                text-align: left;
            }
            #main #middle #center-column form .listing.form .bg .first #TabbedPanels2 .TabbedPanelsContentGroup .TabbedPanelsContent.TabbedPanelsContentVisible table {
                text-align: left;
                float: none;
                font-weight: bold;
            }
            .TableHeading {
                font-weight: bold;
                font-variant: normal;
            }
        </style>
        <link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" />
        <script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script>
    </head>
    <body>
        <div id="main">

            <div id="header">
                <a href="index.html" class="logo"><img src="img/logo.png" width="954" height="112" alt="" /></a>


            </div>
            <div id="middle">
                <div id="left-column">
                    <h3>Home</h3>
                    <ul class="nav">
                        <li><a href="ListOrganController">Organization</a></li>
                        <li></li>
                        <li><a href="Services.jsp">Services</a></li>
                        <li><a href="Premises.jsp">Premises</a></li>
                        <li><a href="#">Forum</a>			    </li>
                        <li class="last"><a href="#">Fsoft Mail</a></li>
                    </ul>
                    <h3>Geograpphy</h3>
                    <ul class="nav">
                        <li> </li>
                        <li> <a href="TRegion.jsp">Trust region</a></li>

                        <li><a href="GovRegion.jsp">Government Region</a></li>
                    </ul>
                    <a href="#" class="link">Help</a>
                    <a href="index.jsp" class="link">Logout</a>
                </div>
                <div></div>
                <script type="text/javascript">
                    function ValidateDep()
                    {
                        var a = document.forms["depform"]["depname"].value;
                        var b = document.forms["depform"]["addressline1"].value;
                        var c = document.forms["depform"]["postcode"].value;
                        var d = document.forms["depform"]["type"].value;
                        
                        if(a == "" || a == null)
                        {
                            alert("Department Name Field Cannot Be Left Blank");
                            return false;
                        }
                        else if(b == "" || b == null)
                        {
                            alert("Address Line1 Field Cannot Be Left Blank");
                            return false;
                        }
                        else if(c == "" || c == null)
                        {
                            alert("Post Code Field Cannot Be Left Blank");
                            return false;
                        }
                        else if(d == "" || d == null)
                        {
                            alert("Type Of Business Field Cannot Be Left Blank");
                            return false;
                        }
                        else
                        {
                              alert("Department Create Successfully");
                            return true;  
                        }
                    }
                </script>
                <div id="center-column"><br />
                    <form id="depform" name="depform" action="AddDepController" method="get" onsubmit="return ValidateDep()">
                        <div class="table">
                            <img src="img/bg-th-left.gif" width="8" height="7" alt="" class="left" />
                            <img src="img/bg-th-right.gif" width="7" height="7" alt="" class="right" />
                            <table width="588" height="466" cellpadding="0" cellspacing="0" class="listing form">
                                <tr>
                                    <th class="full">departments details</th>
                                </tr>
                                <tr class="bg">
                                    <td height="413" class="first"><div id="TabbedPanels2" class="TabbedPanels">
                                            <ul class="TabbedPanelsTabGroup">
                                                <li class="TabbedPanelsTab" tabindex="0">Departments</li>
                                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                <input type="checkbox" name="Inactive" id="Inactive" />
                                                <label for="Inactive">include In-Active </label>
                                            </ul>
                                            <div class="TabbedPanelsContentGroup">
                                                <div class="TabbedPanelsContent">
                                                    <table width="582" border="0" cellspacing="2" cellpadding="2">
                                                        <tr>
                                                            <td width="121" class="normal">Department  Name : <span class="MandatoryColour">*</span></td>
                                                            <td width="166"><label for="depname"></label>
                                                                <input type="text" name="depname" id="depname" /></td>
                                                            <td width="107" class="normal">Type Of Business :<span class="MandatoryColour">*</span></td>
                                                            <td width="162"><label for="type"></label>
                                                                <input name="type" type="text" id="type" size="16" />
                                                                <a href="SearchbusinessType.html" class="normal">Look up</a></td>
                                                        </tr>
                                                        <tr>
                                                            <td class="normal">Department Short Desc :</td>
                                                            <td><label for="description"></label>
                                                                <textarea name="description" id="description" cols="25" rows="3"></textarea></td>
                                                            <td class="normal">department Full Desc :</td>
                                                            <td><label for="full">
                                                                    <textarea name="full" id="full" cols="25" rows="3"></textarea>
                                                                </label></td>
                                                        </tr>
                                                        <tr>
                                                            <td class="normal">Lead Contact :</td>
                                                            <td><label for="type"></label>
                                                                <label for="leadcontact"></label>
                                                                <input name="leadcontact" type="text" id="leadcontact" size="17" />
                                                                <span class="normal"><a href="searchContact.html">Look Up</a></span></td>
                                                            <td class="normal">SIC Code :</td>
                                                            <td><input type="text" name="code" id="code" /></td>
                                                        </tr>
                                                        <tr>
                                                            <td colspan="2" class="normal"><label for="copyAddress">Copy Address from  </label>
                                                                <label for="organization"><input name="radio" type="radio" id="organization" value="organization" checked="checked" />Organizations
                                                                    <input type="radio" name="radio" id="parent" value="parent" />
                                                                    Parent</label></td>
                                                            <td class="normal">Phone Number:</td>
                                                            <td><label for="phone"></label>
                                                                <input type="text" name="phone" id="phone" /></td>
                                                        </tr>
                                                        <tr>
                                                            <td class="normal">Address Line 1 :<span class="MandatoryColour">*</span></td>
                                                            <td><label for="addressline1"></label>
                                                                <input type="text" name="addressline1" id="addressline1" /></td>
                                                            <td class="normal">Fax :</td>
                                                            <td><label for="fax"></label>
                                                                <input type="text" name="fax" id="fax" /></td>
                                                        </tr>
                                                        <tr>
                                                            <td class="normal">Address Line 2</td>
                                                            <td><label for="addressline2"></label>
                                                                <input type="text" name="addressline2" id="addressline2" /></td>
                                                            <td class="normal">Email :</td>
                                                            <td><label for="email"></label>
                                                                <input type="text" name="email" id="email" /></td>
                                                        </tr>
                                                        <tr>
                                                            <td class="normal">Address Line 3</td>
                                                            <td><label for="addressline3"></label>
                                                                <input type="text" name="addressline3" id="addressline3" /></td>
                                                            <td class="normal">Web Address</td>
                                                            <td><label for="webAdd"></label>
                                                                <input type="text" name="webAdd" id="webAdd" /></td>
                                                        </tr>
                                                        <tr>
                                                            <td class="normal">Postcode :<span class="MandatoryColour"> *</span></td>
                                                            <td><label for="postcode"></label>
                                                                <input name="postcode" type="text" id="postcode" size="17" />
                                                                <a href="Searchpostcode.html" class="normal">Look Up</a></td>

                                                            <td>Directorate Name :</td>

                                                            <td><label for="diet"></label>
                                                                <select name="diet" id="diet">
                                                                    <option>Select</option>
                                                                    <%
                                                                        List mist = (List) request.getAttribute("ListDirect");
                                                                        Iterator nit = mist.iterator();
                                                                        while (nit.hasNext()) {
                                                                            DirectoratesBO org = (DirectoratesBO) nit.next();
                                                                            String dname = org.getName();
                                                                            int dat = org.getId();
                                                                    %>
                                                                    <option value="<%= dat%>"><%= dname%></option>
                                                                    <%
                                                                        }
                                                                    %>
                                                                </select></td>

                                                            <td class="normal">&nbsp;</td>
                                                            <td>&nbsp;</td>
                                                        </tr>
                                                        <tr>
                                                            <td class="normal">Town/Village/City</td>
                                                            <td><label for="city"></label>
                                                                <input type="text" name="city" id="city" /></td>
                                                            <td class="normal">&nbsp;</td>
                                                            <td>&nbsp;</td>
                                                        </tr>
                                                        <tr>
                                                            <td class="normal">County</td>
                                                            <td><label for="county"></label>
                                                                <input type="text" name="county" id="county" /></td>
                                                            <td class="normal">&nbsp;</td>
                                                            <td>&nbsp;</td>
                                                        </tr>
                                                        <tr>
                                                            <td class="normal">Nation/Country</td>
                                                            <td><label for="country"></label>
                                                                <select name="country" id="country">
                                                                    <option>Select</option>
                                                                    <%
                                                                        List dist = (List) request.getAttribute("ListCountry");
                                                                        Iterator dit = dist.iterator();
                                                                        while (dit.hasNext()) {
                                                                            CountryBO cont = (CountryBO) dit.next();
                                                                            String name = cont.getCountryName();
                                                                            int id = cont.getID();
                                                                    %>
                                                                    <option value="<%=id%>"><%= name%></option>
                                                                    <%
                                                                        }
                                                                    %>
                                                                </select></td>
                                                            <td class="normal">&nbsp;</td>
                                                            <td>&nbsp;</td>
                                                        </tr>
                                                    </table>
                                                </div>
                                            </div>
                                        </div>					    <label for="CHECK3"></label></td>
                                </tr>
                                <tr class="bg">
                                    <td class="first"><input type="submit" name="save" id="save" value="save" /></td>
                                    </form>
                                    <form id="depback" name="depback" method="get" action="DirectorateController">
                                        <td><input type="submit" name="Back" id="Back" value="Back" /></td>
                                </tr>
                            </table></form>
                    <p>&nbsp;</p>
                </div>
            </div>
            <div id="right-column">
                <strong class="h">INFO</strong>
                <div class="box">This screen is use to add supporting materials for organization</div>
            </div>
        </div>
        <div id="footer">
            <p>&nbsp;</p>
            <p>&nbsp;</p>
        </div>
        </div>
        <script type="text/javascript">
            var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanels2");
        </script>
    </body>
</html>
